import Vue from 'vue'
import axios from 'axios'

import App from './App'
import router from './router'
import store from './store'

let BrowserWindow = require('electron').remote.BrowserWindow
let ipcRenderer = require('electron').ipcRenderer
Vue.prototype._BrowserWindow = BrowserWindow
Vue.prototype._ipcRenderer = ipcRenderer

if (!process.env.IS_WEB) Vue.use(require('vue-electron'))
Vue.http = Vue.prototype.$http = axios
Vue.config.productionTip = false

Vue.prototype.__winURL = process.env.NODE_ENV === 'development'
  ? `http://localhost:9080`
  : `file://${__dirname}/index.html`

/* eslint-disable no-new */
new Vue({
  components: { App },
  router,
  store,
  template: '<App/>'
}).$mount('#app')
